package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

@TableName("t_mainPost")
public class MainPostBean {
    @TableId(value = "pk_mainPostID",type = IdType.AUTO)
    private Integer id;
    @TableField("mp_title")
    private String title;
    @TableField("mp_content")
    private String content;
    @TableField("fk_userID")
    private Integer userID;
    @TableField(exist = false)
    private UserBean userBean;
    @TableField("fk_channelID")
    private Integer channelID;
    @TableField(exist = false)
    private ChannelBean channelBean;
    @TableField("mp_date")
    private LocalDate date = LocalDate.now();
    @TableField(exist = false)
    private Integer sumReply;
    @TableField(exist = false)
    private List<ReplyBean> replyList;

    public MainPostBean() {
    }

    public MainPostBean(String title, String content, Integer userID, Integer channelID) {
        this.title = title;
        this.content = content;
        this.userID = userID;
        this.channelID = channelID;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getUserID() {
        return userID;
    }

    public void setUserID(Integer userID) {
        this.userID = userID;
    }

    public UserBean getUserBean() {
        return userBean;
    }

    public void setUserBean(UserBean userBean) {
        this.userBean = userBean;
    }

    public Integer getChannelID() {
        return channelID;
    }

    public void setChannelID(Integer channelID) {
        this.channelID = channelID;
    }

    public ChannelBean getChannelBean() {
        return channelBean;
    }

    public void setChannelBean(ChannelBean channelBean) {
        this.channelBean = channelBean;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getSumReply() {
        return sumReply;
    }

    public void setSumReply(Integer sumReply) {
        this.sumReply = sumReply;
    }

    public List<ReplyBean> getReplyList() {
        return replyList;
    }

    public void setReplyList(List<ReplyBean> replyList) {
        this.replyList = replyList;
    }

    @Override
    public String toString() {
        return "\nMainPostBean{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", userID=" + userID +
                ", userBean=" + userBean +
                ", channelID=" + channelID +
                ", channelBean=" + channelBean +
                ", date=" + date +
                ", sumReply=" + sumReply +
                ", replyList=" + replyList +
                '}';
    }
}
